package com.stylefeng.guns.modular.system.warpper;

import com.stylefeng.guns.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.common.warpper.BaseControllerWarpper;

import java.util.List;
import java.util.Map;

public class OrgInfoWarpper extends BaseControllerWarpper {

    public OrgInfoWarpper(List<Map<String, Object>> list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
        map.put("userName", ConstantFactory.me().getJoinStepUserNameById((Integer) map.get("joinId")));
        map.put("currentState", ConstantFactory.me().getCurrentStateById((Integer) map.get("joinId")));
        map.put("reason",ConstantFactory.me().getJoinStepReasonById((Integer)map.get("joinId")));
        if((Integer) map.get("currentState")!=null){
            if((Integer) map.get("currentState")==98){
                map.put("currentState", "已拒绝");
            }else if((Integer) map.get("currentState")==97){
                map.put("currentState", "待审核");
            }else if((Integer) map.get("currentState")==99){
                map.put("currentState", "已通过");
            }else{
                map.put("currentState", "进行中");
            }
        }else{
            map.put("currentState", "");
        }
    }
}
